#!/usr/bin/python
# --coding:utf-8--


import requests

url = "https://complexsearch.kugou.com/v2/search/song?callback=callback123&srcappid=2919&clientver=1000&clienttime=1728437492210&mid=14ffa87c1368097c22198459b6afea4a&uuid=14ffa87c1368097c22198459b6afea4a&dfid=4FHAKO0K1DUY11EziB1D5CgF&keyword=%E6%9D%8E%E8%8D%A3%E6%B5%A9&page=1&pagesize=30&bitrate=0&isfuzzy=0&inputtype=0&platform=WebFilter&userid=0&iscorrection=1&privilege_filter=0&filter=10&token=&appid=1014&signature=4f9380781581307ba78be156e48af1e1"
headers = {
    "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0"
}


# 利用requests对象的post方法，对指定的url发起请求
# 该方法会返回一个Response对象
res = requests.get(url, headers=headers)
print(type(res))
# 通过Response对象的text方法获取网页的文本信息
print(res.text)
save_file = 'musicKG.txt'
with open(save_file, 'w', encoding='utf-8') as file:
    file.write(res.text)
    print('保存成功！')
